<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>商品订单管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/order/goodsOrder/">商品订单列表</a></li>
		<shiro:hasPermission name="order:goodsOrder:edit"><li><a href="${ctx}/order/goodsOrder/form">商品订单添加</a></li></shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="goodsOrder" action="${ctx}/order/goodsOrder/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li><label>商品ID：</label>
				<form:input path="goodsId" htmlEscape="false" maxlength="11" class="input-medium"/>
			</li>
			<li><label>商品名称：</label>
				<form:input path="goodsName" htmlEscape="false" maxlength="100" class="input-medium"/>
			</li>
			<li><label>计量单位：1斤2个3盒4箱5袋：</label>
				<form:input path="unit" htmlEscape="false" maxlength="1" class="input-medium"/>
			</li>
			<li><label>下单时间：</label>
				<input name="beginCreateDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
					value="<fmt:formatDate value="${goodsOrder.beginCreateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/> - 
				<input name="endCreateDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
					value="<fmt:formatDate value="${goodsOrder.endCreateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
			</li>
			<li><label>下单用户：</label>
				<form:input path="createBy.id" htmlEscape="false" maxlength="11" class="input-medium"/>
			</li>
			<li><label>订单状态（1：已付款 2：配送中 3：已完成 4：已退单）：</label>
				<form:input path="status" htmlEscape="false" maxlength="1" class="input-medium"/>
			</li>
			<li><label>客户ID：</label>
				<sys:treeselect id="user" name="user.id" value="${goodsOrder.user.id}" labelName="user.name" labelValue="${goodsOrder.user.name}"
					title="用户" url="/sys/office/treeData?type=3" cssClass="input-small" allowClear="true" notAllowSelectParent="true"/>
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>商品ID</th>
				<th>商品名称</th>
				<th>商品数量</th>
				<th>成本价格</th>
				<th>销售价格</th>
				<th>计量单位：1斤2个3盒4箱5袋</th>
				<th>下单时间</th>
				<th>下单用户</th>
				<th>订单状态（1：已付款 2：配送中 3：已完成 4：已退单）</th>
				<th>备注</th>
				<th>客户ID</th>
				<shiro:hasPermission name="order:goodsOrder:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="goodsOrder">
			<tr>
				<td><a href="${ctx}/order/goodsOrder/form?id=${goodsOrder.id}">
					${goodsOrder.goodsId}
				</a></td>
				<td>
					${goodsOrder.goodsName}
				</td>
				<td>
					${goodsOrder.num}
				</td>
				<td>
					${goodsOrder.costPrice}
				</td>
				<td>
					${goodsOrder.salePrice}
				</td>
				<td>
					${goodsOrder.unit}
				</td>
				<td>
					<fmt:formatDate value="${goodsOrder.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
				<td>
					${goodsOrder.createBy.id}
				</td>
				<td>
					${goodsOrder.status}
				</td>
				<td>
					${goodsOrder.remarks}
				</td>
				<td>
					${goodsOrder.user.name}
				</td>
				<shiro:hasPermission name="order:goodsOrder:edit"><td>
    				<a href="${ctx}/order/goodsOrder/form?id=${goodsOrder.id}">修改</a>
					<a href="${ctx}/order/goodsOrder/delete?id=${goodsOrder.id}" onclick="return confirmx('确认要删除该商品订单吗？', this.href)">删除</a>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>